home *** CD-ROM | disk | FTP | other *** search
- /* #include file for the C interface to SAT */
-
- /* Comment out under TC5: */
- /*#include <Color.h>*/
- /*#include <WindowMgr.h>*/
- /*#include <DialogMgr.h>*/
-
-
-
- #ifndef true
- #define true 1
- #endif
-
- #ifndef false
- #define false 0
- #endif
-
- #ifndef nil
- #define nil 0L
- #endif
-
- typedef struct face {
- char *colorData;
- int resNum;
- BitMap iconMask;
- int rowBytes; /* Note! No flags in the highest bits!*/
- struct face *next;
- RgnHandle maskRgn;
- } Face, *FacePtr;
-
- typedef struct sprite {
- /* Variables that you should change as appropriate */
- int kind;
- Point position;
- Rect hotrect, hotrect2;
- FacePtr face;
- ProcPtr task;
- ProcPtr hittask;
- /* SAT variables that you shouldn't change: */
- Point oldpos;
- struct sprite *next, *prev;
- Rect r, oldr;
- /* Variables for free use by the application: */
- int layer;
- Point speed;
- int mode;
- Ptr appPtr;
- long appLong;
- } Sprite, *SpritePtr;
-
- typedef struct{
- int patternType; /* 1 = Pattern, PatHandle, 2 = PixPat, PixPatHandle */
- PixPatHandle thePat; /* or PatHandle */
- } SATPattern, *SATPatPtr, **SATPatHandle;
-
- /* Constants for ConfigureSAT */
- enum{VPositionSort=0, LayerSort, NoSort};
- enum{KindCollision=0, ForwardCollision, BackwardCollision, NoCollision};
-
- /* Global variables */
- extern WindowPtr SATwind; /* The window that SAT draws in. */
- extern GrafPtr offScreen; /* Offscreen image */
- extern GrafPtr backScreen; /* Background image */
- extern GDHandle offScreenGD, backScreenGD; /*Graphic devices for offScreen and BackScreen*/
- extern long ox,oy; /* Origin-variables, tells SAT where in the window to draw*/
- extern int SATpict, SATbwpict; /* PICT resource IDs, value 0 ignored */
-
- /* Screen size parameters. */
- /* Usually, you will only need to inspect OurDepth, ColorFlag, OffSizeH and OffSizeV */
- /* The others are subject to change or go away */
- extern PixMapHandle ourScreen;
- extern Ptr ourBaseAddr;
- extern int ourRowBytes;
- extern Rect ourBounds;
- extern int ourDepth; /* Depth of screen and offscreens */
- extern Boolean colorFlag; /* Is this Mac color capable? */
- extern Boolean anyMonsters; /* False when no sprites with kind < -1 are active, KindCollision only */
-
- extern int offSizeH, offSizeV; /* Size of the animation area - use for border checks */
-
- /*Utilities*/
- pascal void DrawInt (int);
- pascal void DrawLong (long);
- pascal int Rand (int);
- pascal int Rand10();
- pascal int Rand100();
- pascal void ReportStr (Str255);
- pascal Boolean QuestionStr(Str255);
- pascal void CheckNoMem (Ptr);
- pascal void SetMouse (Point);
- /* Pattern utilities */
- pascal void SATPenPat (SATPatHandle);
- pascal void SATBackPat (SATPatHandle);
- pascal SATPatHandle SATGetPat (int);
- pascal void SATDisposePat (SATPatHandle);
-
- /*Sound*/
- pascal void InitSATSound(); /* No longer necessary */
- pascal void SATSoundPlay (Handle, int, Boolean); /* Play sounds with priority handling */
- pascal void SATSoundShutup(); /*Silence, dispose of sound channel*/
- pascal void SATSoundEvents(); /* Call this once in a while when not calling RunSAT often */
- pascal Boolean SATSoundDone(); /* Any sound going on?*/
- pascal Handle SATGetSound (int);
- pascal Handle SATGetNamedSound (Str255);
- pascal void SATDisposeSound (Handle);
- pascal void SATSoundOn();
- pascal void SATSoundOff();
-
- /* SAT routines */
-
- /* Initialization */
- pascal void ConfigureSAT(Boolean, int, int, int);
- pascal WindowPtr InitSAT (int, int, int, int);
- pascal WindowPtr CustomInitSAT (int, int, Rect, WindowPtr, GDHandle, Boolean, Boolean, Boolean, Boolean);
- /* Maintainance, background manipulation etc. */
- pascal Boolean SATDepthChangeTest();
- pascal void SATDrawPICTs (int, int);
- pascal void PeekOffscreen();
- /* Drawing */
- pascal void SATPlotFace(FacePtr, GrafPtr, GDHandle, Point, Boolean); /*Draw a Face (icon).*/
- pascal void SATPlotFaceToScreen(FacePtr, Point, Boolean); /*NEW*/
- pascal void SATCopyBits(GrafPtr, GrafPtr, GDHandle, Point, Point, int,int,Boolean); /*NEW*/
- pascal void SATCopyBitsToScreen(GrafPtr,Point,Point,int,int,Boolean); /*NEW*/
- pascal void SATBackChanged (Rect); /*Tell SAT about changes in BackScreen*/
- pascal void SATSetPortOffScreen(); /*Use before Quick-Drawing on offScreen*/
- pascal void SATSetPortBackScreen(); /*Use before Quick-Drawing on BackScreen*/
- pascal void SATSetPortScreen(); /*Use to restore after drawing off/backscreen*/
- /* Sprite handling */
- pascal FacePtr GetFace (int);
- pascal void DisposeFace (FacePtr);
- pascal SpritePtr NewSprite (int,int,int, ProcPtr, ProcPtr, ProcPtr);
- pascal SpritePtr NewSpriteAfter (SpritePtr,int,int,int, ProcPtr, ProcPtr, ProcPtr);
- pascal void KillSprite (SpritePtr);
- /* Animating */
- pascal void RunSAT (Boolean);
- /* Menu bar */
- pascal void ShowMBar();
- pascal void HideMBar(WindowPtr);
- /* Advanced special-purpose calls */
- pascal void SATInstallSynch (ProcPtr);
- pascal void SATSetSpriteRecSize (long);
- pascal void SkipSAT();
- /* Offscreen - use only if you need an *extra* offscreen buffer. These calls are likely to change in the future!*/
- pascal void SATMakeOffscreen (GrafPtr*, Rect, GDHandle*); /*Make offscreen buffer in current screen depth and CLUT.*/
- pascal void SATDisposeOffScreen (GrafPtr, GDHandle); /*Get rid of offscreen*/
- pascal OSErr CreateOffScreen (Rect, int, CTabHandle, CGrafPtr*, GDHandle*); /*From Principia Offscreen*/
- pascal void DisposeOffScreen (CGrafPtr, GDHandle);/*From Principia Offscreen*/
-